<script setup>
import { defineProps, defineEmits } from 'vue';

const props = defineProps({
  formList: {
    type: Array,
    required: true
  }
});

const emits = defineEmits(['update:value']);

//更新函数
function updateValue(index, event) {
  emits('update:value', index, event.target.value);
}
</script>

<template>
  <div v-for="(item, index) in props.formList" :key="index">
    <input
      :style="{width:item.Iwidth,height:item.height,borderRadius:item.radius}"
      :type="item.type"
      :name="item.username"
      :value="item.modelValue"
      @input="updateValue(index, $event)"
    />
  </div>
</template>